package com.gsq.controller;

import com.gsq.common.pojo.Sys_menu;
import com.gsq.common.vo.SysResult;
import com.gsq.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/admin")
public class MenuController {

    @Autowired
    private MenuService menuService;
    @GetMapping("/getMenu")
    public SysResult getMenu(){
        List<Sys_menu> menuList = menuService.getMenu();
        return SysResult.success(menuList);
    }
}
